package cs4295asg2.stockfinder;

import java.io.Serializable;
import java.text.DecimalFormat;

public class StockTarget implements Serializable {
    private String number;
    private double targetPrice;
    private double currentPrice;
    private DecimalFormat df;
    public StockTarget(){
        super();
    }
    
    public StockTarget(String number, double currentPrice) {
        super();
        this.number = number;
        this.currentPrice = currentPrice;
        this.targetPrice = 0; 
    }

    public void setTargetPrice(double price) {
    	this.targetPrice = price;
    }
    
   public String getNumber(){
	   return this.number;
   }
   
   public double getCurrPrice() {
	   return this.currentPrice;
   }
   
   public void setCurrPrice(double currentPrice){
	   this.currentPrice = currentPrice;
   }
   
   public double getTargetPrice() {
	   return this.targetPrice;
   }
   
    @Override
    public String toString() {
        df = new DecimalFormat("000.000"); 
        return this.number + " [$" + df.format(this.currentPrice*1.0000) + "]"+ "          " + df.format(this.targetPrice*1.0000);
    }
    public String getString() {
        return this.number+','+this.currentPrice+','+this.targetPrice; 
    }
}
